package com.itheima.dao;

import com.itheima.domain.User;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.FetchType;

import java.util.List;

public interface Userdao {

    //查询所有
    @Select("select*from user")
    @Results( id="xiugaidomain",value = {
            @Result(id=true,column="id",property = "userId"),
            @Result(column="username",property = "userName"),
            @Result(column="address",property = "userAddress"),
            @Result(column="sex",property = "userSex"),
            @Result(column="birthday",property = "userBirthday"),
            @Result(column ="id",property = "accountList" ,
         many=@Many(select = "com.itheima.dao.Accountdao.findone" ,
                 fetchType = FetchType.LAZY )

            )
    })
    List<User> findall();




}
